﻿using System;
using System.Globalization;
using System.Windows.Data;
using Labthink.PCSoft.UniversalHost4.Utility;

namespace Labthink.PCSoft.UniversalHost4.Converters
{
    public class OperateResultConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value.ToInt() >= 0) return LanguageManager.GetLanguageValue("ActionSuccess");
            return LanguageManager.GetLanguageValue("ActionFail");
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }
    }
}
